Custom Adapter
To add a custom adapter to your Cocos2d-x app, configure each platform as follows:
- Android
- iOS
Gradle (Android)
- Add your adapter's Maven repository (if required) to the top-level
build.gradle
/build.gradle.kts
:
- build.gradle
- build.gradle.kts
allprojects {
repositories {
// ... existing repositories
maven { url "https://custom.repository.com/maven" }
}
}
allprojects {
repositories {
// ... existing repositories
maven { url = uri("https://custom.repository.com/maven") }
}
}
- Add the adapter dependency to your app module
app/build.gradle
orapp/build.gradle.kts
:
- app/build.gradle
- app/build.gradle.kts
dependencies {
implementation 'com.custom.package:custom-adapter:1.0.0'
}
dependencies {
implementation("com.custom.package:custom-adapter:1.0.0")
}
CocoaPods (iOS)
- Add your adapter's pod to the
Podfile
and ensure required sources are present:
source 'https://github.com/x3mads/podspecs.git'
source 'https://cdn.cocoapods.org/'
target 'YourAppTarget' do
# ... other pods
pod 'CustomAdapter', '1.0.0'
end
- Install pods:
pod install --repo-update
note
Replace the placeholder coordinates (group:artifact:version
, pod name/version, and repository URLs) with the actual details provided by your adapter.
tip
If you encounter issues integrating your adapter, consult the adapter's documentation or contact the provider for support.